﻿using System.Text.Json.Serialization;
using Simple.Common.Helpers;

namespace Simple.Services;

public class LecturerModel : ModelBase
{
    /// <summary>
    /// 主键
    /// </summary>
    public Guid? Id { get; set; }

    /// <summary>
    /// 讲师姓名
    /// </summary>
    public string? Name { get; set; }

    /// <summary>
    /// 讲师分类
    /// </summary>
    public int LecturerType { get; set; }

    /// <summary>
    /// 讲师分类
    /// </summary>
    public string? LecturerTypeStr { get; set; }

    /// <summary>
    /// 介绍
    /// </summary>
    public string? Description { get; set; }


    public override void ConfigureMapper(Profile profile)
    {
        profile.CreateMap<Lecturer, LecturerModel>()
            .ForMember(d => d.LecturerType, options => options.MapFrom(s => (int)s.LecturerType))
            .ForMember(d => d.LecturerTypeStr, options => options.MapFrom(s => EnumHelper.GetDescriptionContent(s.LecturerType)));

        profile.CreateMap<LecturerModel, Lecturer>();

    }

}
